package com.android.activity.adapter;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Lifecycle;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import com.android.activity.fragment.GoodShowFragment;
import com.android.bean.Good;
import com.android.bean.GoodsType;

import java.util.List;

public class GoodsTypeFSAdapter extends FragmentStateAdapter{
    private List<GoodsType> goodsTypeList;
    private List<Fragment> fragmentList;

    public GoodsTypeFSAdapter(@NonNull FragmentManager fragmentManager,
                              @NonNull Lifecycle lifecycle,
//                              List<GoodsType> goodsTypeList, List<Goods> goodsList,
                              List<Fragment> fragmentList){
        super(fragmentManager, lifecycle);
        this.fragmentList = fragmentList;
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {

        return fragmentList.get(position);
    }

    @Override
    public int getItemCount() {
        return fragmentList.size();
    }
}
